<?php
class Ls extends CI_Model {

//     var $title   = '';
//     var $content = '';
//     var $date    = '';

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function get_last_ten_entries()
    {
        $query = $this->db->get('entries', 10);
        return $query->result();
    }
    function get_term_relationships($term_taxonomy_id)
    {
      $term_relationships = $this->db->get_where('wp_term_relationships', array('term_taxonomy_id' => $term_taxonomy_id));
      if( $term_relationships->num_rows() == 0)
      {
        return(FALSE);
      }
      else
      {
        return $term_relationships;
      }
    }
    

//     function insert_entry()
//     {
//         $this->title   = $_POST['title']; // please read the below note
//         $this->content = $_POST['content'];
//         $this->date    = time();
// 
//         $this->db->insert('entries', $this);
//     }

//     function update_entry()
//     {
//         $this->title   = $_POST['title'];
//         $this->content = $_POST['content'];
//         $this->date    = time();
// 
//         $this->db->update('entries', $this, array('id' => $_POST['id']));
//     }

}